package org.example.entity;

import org.example.dao.FullDataMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * DeptMapper类的作用就是填充数据
 */
public class EmployeeMapper implements FullDataMapper<Employee> {
    public Employee map(ResultSet rs) throws SQLException {
        return new Employee(
                rs.getInt("emp_id"),
                rs.getString("emp_name"),
                rs.getString("job"),
                rs.getInt("mgr_id"),
                rs.getDate("hire_date"),
                rs.getDouble("sal"),
                rs.getDouble("comm"),
                rs.getInt("dept_id")
        );
    }
}
